import kotlin.properties.Delegates

/**
 * Created by xmqian on 2024/11/17.
 */

class User {
    var name: String by Delegates.observable("<no name>") {
        prop, old, new ->
        println("$old -> $new")
    }
}

    fun main(args:Array<String>) {
        val user = User()
        user.name = "first"
        user.name = "second"
    }